package com.tyc.es.model;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

@Document(indexName = "user")
public class User {
    @Id
    private int id;
    private String name;
    private String pas;
    @Field(type = FieldType.Integer)
    private int age;
    @Field(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date date;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPas() {
        return pas;
    }

    public void setPas(String pas) {
        this.pas = pas;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public User(int id, String name, String pas, int age, Date date) {
        this.id = id;
        this.name = name;
        this.pas = pas;
        this.age = age;
        this.date = date;
    }
}
